#pragma once

#include "../umlmodel_global.h"

#include <memory>
#include <vector>

#include "WriteStructuralFeatureAction.h"

using std::make_shared;
using std::shared_ptr;
using std::vector;

namespace uml {
class InputPin;

/// <summary>
/// AddStructuralFeatureValueAction
/// An AddStructuralFeatureValueAction is a WriteStructuralFeatureAction for adding
/// values to a StructuralFeature.
/// </summary>
class UMLMODEL_EXPORT AddStructuralFeatureValueAction : public WriteStructuralFeatureAction {

public: // Constructors and destructors
    explicit AddStructuralFeatureValueAction(const QString& umlType="uml::AddStructuralFeatureValueAction");

public: // JsonSerializable override
    void fromJson(const QJsonObject& json, QStringList& errorList) override;
    void toJson(QJsonObject& json) override;

public: // Properties
    /// <summary>
    /// insertAt getter
    /// The InputPin that gives the position at which to insert the value in an ordered
    /// StructuralFeature. The type of the insertAt InputPin is UnlimitedNatural, but
    /// the value cannot be zero. It is omitted for unordered StructuralFeatures.
    /// </summary>
    shared_ptr<InputPin> insertAt() const;

    /// <summary>
    /// insertAt setter
    /// The InputPin that gives the position at which to insert the value in an ordered
    /// StructuralFeature. The type of the insertAt InputPin is UnlimitedNatural, but
    /// the value cannot be zero. It is omitted for unordered StructuralFeatures.
    /// </summary>
    void setInsertAt(shared_ptr<InputPin> value);

    /// <summary>
    /// isReplaceAll getter
    /// Specifies whether existing values of the StructuralFeature should be removed
    /// before adding the new value.
    /// </summary>
    bool isReplaceAll() const;

    /// <summary>
    /// isReplaceAll setter
    /// Specifies whether existing values of the StructuralFeature should be removed
    /// before adding the new value.
    /// </summary>
    void setIsReplaceAll(bool value);

private: // Fields
    /// <summary>
    /// insertAt
    /// The InputPin that gives the position at which to insert the value in an ordered
    /// StructuralFeature. The type of the insertAt InputPin is UnlimitedNatural, but
    /// the value cannot be zero. It is omitted for unordered StructuralFeatures.
    /// </summary>
    shared_ptr<InputPin> insertAt_;

    /// <summary>
    /// isReplaceAll
    /// Specifies whether existing values of the StructuralFeature should be removed
    /// before adding the new value.
    /// </summary>
    const static bool isReplaceAll_default_;
    bool isReplaceAll_= isReplaceAll_default_;

};

} // namespace uml
